<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<s:layout-definition>
<html>
<head>
  <title><f:message key="heading" /></title>
  <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style.css" />
  <s:layout-component name="hlavicka"/>
</head>
<body>
    <div id="hd">
        <div id="title"><h1><f:message key="${nadpis}"/></h1></div>        
        <sec:authorize access="isAnonymous()">
            <s:link class="button" beanclass="cz.muni.fi.pa165.carparkweb.actionbeans.AuthorizationActionBean" event="login"><f:message key="user.login"/></s:link>
        </sec:authorize>
        <sec:authorize access="isAuthenticated()">
            <a href="${pageContext.request.contextPath}/j_spring_security_logout" class="button"><f:message key="user.logout"/></a>
        </sec:authorize>
    </div>
   
   <div id="menu">
     <ul>
       <li><s:link href="/"><f:message key="home"/></s:link></li>
       <sec:authorize access="hasAnyRole('superadmin','employee_manager')">
       <li><s:link href="/employee/all"><f:message key="employeeManagment"/></s:link></li>
       <li><s:link href="/businesstrip/all"><f:message key="businessTripManagment"/></s:link></li>
       </sec:authorize>
       <sec:authorize access="hasAnyRole('superadmin','vehicle_manager')">
       <li><s:link href="/vehicle/all"><f:message key="vehicleManagment"/></s:link></li>
       <li><s:link href="/servicecheck/all"><f:message key="serviceCheckManagment"/></s:link></li>
       </sec:authorize>
       <sec:authorize access="hasRole('superadmin')">
       <li><s:link href="/data"><f:message key="createSampleData"/></s:link></li>
       <li><s:link href="/auth"><f:message key="user.createNew"/></s:link></li>
       </sec:authorize>
       <sec:authorize access="isAnonymous()">
       <li><s:link beanclass="cz.muni.fi.pa165.carparkweb.actionbeans.AuthorizationActionBean" event="createSuperUser"><f:message key="user.createsuper"/></s:link></li>
       </sec:authorize>
     </ul>
   </div>
   <div id="bd">       
       <s:layout-component name="telo"/>
    </div>
    
    
    <div id="ft">
    </div>
</body>
</html>
</s:layout-definition>